perm filename POOLTY.WEB[TEX,DEK]2 blob sn#682264 filedate 1982-10-18 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00007 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% This program by D. E. Knuth is not copyrighted and can be used freely.
C00005 00003	@* Introduction.
C00008 00004	@* The character set.
C00022 00005	@* String handling.
C00036 00006	@* System-dependent changes.
C00037 00007	@* Index.
C00050 ENDMK
C⊗;
% This program by D. E. Knuth is not copyrighted and can be used freely.
% Version 1 was implemented in June 1982.

% Here is TeX material that gets inserted after \@%]akh↓oKEQ⊃d~∃9⊃KM9Q¬]Ow9!C]OS9IK]hgK[9%]IK]Q9SO]=eKga¬GK|~)9IKMq)K1wQ9QE←aw9Qg-S`Z\DlloK59Y←o∃d\hdQKq9Q	←qwy9QgW%`Z\bHkKZAa⎇|~∃q]KoM=]hAG5ds9SM9]S]∃eZ~∃qIKM95Gw8uq]S]KI[t@J↓[CISUZAGCAfAM←HA]C[∃bAYS-JA!βMπβ_~)9IKMq!β'π¬→ww→5FA!βMπβ→⎇x~∀~∃qIKM8 FbSwx@JAi!SfASLAkgK⊂Ai↑A5CWJA5←IkY∀A]C[∃fAg←IhAiQ∃[gKYYKfAE∃iaKd4∃9IK→8rFcm|@JAQQSfA%fAkg∃HAM←HAg←ePAWKsLAS\AQQJAS9IKp~(~∃9I∃M9iSQYKw!=∨→9Y=oKeG¬gKwieaK⎇|4∃9IK→9G←]QK]igACOK]U[EKelb`c|4∃9IK→9i←a=MG←]QK]igm9]kY0~∀∪9⊃KM9i%iYKa¬OKw
x@JAS9GYkI∀AQKC⊃YS]J↓←\Ai!JAG←9iK]iLAaCO∀~∀∪9⊃KM9e!KCIKIw8u95CS]M=]i9Q→SXA9
←]iK9igaC≥K]k[	Ke|~(∪9mM%YX~∀%9Gie1S]Kwpu9iSQYKM←9hA)Q∀Aw8uqiiSi1KM←]PA!∨∨1isaKxAae←
Kgg←I|~∀∪qmgWS@@bkaP~∀∪9
ieYS9KvQ-∃egS←8@bXA)k]J@DrpdSx~∀∪9YMSYYx~∃9I∃M9E←Q←MG←9iK]iMw9mM%YX~∀%9Gie1S]KwqQgSu∀@kS]qECgK1S]Kg-S`saP~∀∩∪qmE←qm8u9]%]Ke[q]←S]⊃K]h~(∩∪)Q∀AaeKACeCi%←\A←_AiQSLAeKa=eh~∀$∪oCf↓gkaa=eiKH↓S\Aa¬ehAEdAiQJ↓≥CiS=]CXAMGSK]
J~∀∩%
←k]⊃CiS←8Ak]I∃dAOe¬]ifA%'(ZpH`brdXAC]H↓≠π&Z\ndfnLpX~∀$∪C]H↓ErAi!JA'sMiKZA⊃KmKY=a[K]PA
←k9ICiS=\\AAq)K0N↓SfAB4∀∩∪iICIK[¬eVA←_AiQJ↓β[Ke%GC\A5CiQK5CiSG¬XA'←
SKir9⎇⎇|~)9gKi
←k]h@{9G←9iK]iMaCOK9k[EKHA9CIYG←k]P`AErb~∀→TA%]ie←⊃kGiS=\\~∃QQJA89w!∨∨1isaKxAkiS1SirAAe←Oe¬ZAG←9mKeiLAgie%]NAa=←XAM%YKfA=kiakP~∃Er↓8]w)¬≥∂→xAS]i<ABAg1SOQi1rA[←IJAgs5E←YSAM←e5ChAi!ChA[¬rAEJ↓kgKMUX~∃o!K\A89w)β≥≥→⎇H↓ae←OIC[fA¬eJAE∃S]NA⊃KEkO≥KH\~(~∃∪h≥fABAAeKiidAieSYSCXAI←kiS9JXAEUhAaK=aYJA5CrAo¬]hAi<Aier↓ieC]Ma←ei%]N~∃QQSfAAe←Oe¬ZAEK→←eJAQQKrA≥KhAk@AK]←UOPAG=keCO∀Ai↑AQCGWY∀A9)Ka8ASiMKYL\4∃)QJ↓MSegP@bdp↓gieS9OfACIJAie∃CiKH↓CfA9QK18AQeKCiLAiQK4XAkg%]NAe=kiS]∃f~∃G=aSKH↓Me←Z↓9)K0`d\~∀4∃A89w!∨∨1isaKxASfA]eSii∃\AK]QSeKYdAS\AMiC]I¬eHA9Aβ'πβ0XAKq
KahAQQChA%hAQCL~∃i↑↓I↑Ag=[JAg1SOQi1rAgsMiKZ[⊃KaK]⊃K]hA
QCeC
iKdA
←IJA
←]mKIgS←\↓←\AS9akh~)C]HA=kiakP\A)Q∀AS]aUhASf↓eKCH↓Me←Z↓ya←←01MSY∃xXAC9HAiQ∀A←kiAkhASLAoeSQiK\~)←\Ay=kiakQx\A∪_AiQJ↓S]akPASfA∃ee←]∃←kfX↓iQJAq←kiaUixAM%YJAo%YXAI∃gGeS	J~∃i!JAKeI←d\~)↓=gsMiKZA⊃KaK]⊃K]GS∃g|~(~∃↓`↓ae←OICZA!=∨→isAJQCA←←X1→SYJYC←kiAkhRv4∃YCE∃X@rrdrvAwQQSfA1CEKYLAiQJ↓K]HA=LAiQ∀Aae←≥eC[|4∃isa∀Ay)eaKfA%\AiQ∀A←ki∃dAEY=GW⎇↑~∃m¬e␈q∂Y←E¬YfAS8AiQJ↓←kiKHAEY←
W⎇<~∃ae=GKIkIJAS]%iSCY%uJvAmiQSf↓ae←G∃IkeJ↓OKif↓iQS]≥fAgi¬eiKH↓ae←a∃eYs|4∀∪mCHAy→=GCXAYCeSC	YKfA→←dAS9SiSC1SuCi%←]⎇v~∀∪	KOS\↓y'KPAS]SQSCXAYCYkKLA←LA-KrAm¬eSCE1Kg⎇↑~∀∪∃]Hv~(~∃A!KeJA¬eJAg=[JA[¬Ge←f↓M←dA
←[[←8Aae←≥eC[[%]NAS⊃S←[f8~∀~∃↓HAS]
dPFRzz@G|FVbAmS]Ge∃CgJA∧AmCe%CEYJ↓ErAk9Sis|4∃↓HA⊃KGdPR@zzG>FZDAwIK
eKCg∀ABAm¬eSCE1JAEr↓k]Sie|~∃↓⊂AI↑19←iQS9N@zz↓wK[aQrAgi¬iK[K9i|~∀→TAQQJAG!CeCGQKdAg∃h\~∀!)QJA→←YY←]S]NA5CiKe%CXASLAG←a%KHAm∃eECi%ZAMe=ZA9)∃0pd\4∃)QkLXAiQ∀AgC[∀AgsgQKZ[I∃aK]I∃]hAG!C]OKLAgQ←UYHAE∀A[CI∀Ai↑A	←iPAAe←Oe¬[f\R4∀~∃∪8A←eI∃dAi↑↓[CWJ↓9)K1pAeKC⊃SYrAA←eiC	YJAE∃ioKK8ABAo%IJAmriety of
computers, all of its input text is converted to an internal seven-bit
code that is essentially standard ascii, the ``American Standard Code for
Information Interchange.''  This conversion is done immediately when each
character is read in. Conversely, characters are converted from ascii to
the user's external representation just before they are output to a
text file.

Such an internal code is relevant to users of \TeX\ primarily because it
governs the positions of characters in the fonts. For example, the
character `\.A' has ascii code $65=@'101$, and when \TeX\ typesets
this letter it specifies character number 65 in the current font.
If that font actually has `\.A' in a different position, \TeX\ doesn't
know what the real position is; the program that doeq the actual printing from
\TeX's devi@
J[S]⊃KaK]⊃K]hA→SYKf↓SfAe∃ga←]MSEYJ↓MWdA
←]mKIiS]N↓Me←Z↓CgGS$Ai↑~)BAaCIiSGk1CdAM=]hAK9G←IS9N\~∃↓=CgG%RAG←⊃K|~(~∃9)∃0OfA%]iKe9CXAG=IJASLAeKY∃mC]h↓CYg↑↓oSiP↓eKga∃GhAi<AG←]MiCMiL~∃iQ¬hAEK≥S\Ao%iPAB↓eKmKIgJACA←gie=aQJv↓C]HA%hAae=mSIKLAC\A%]IKp↓iVAi!J~∃89w99G!G←IKxXA8]m99[CQQG←I∃|XA89w99k
G←IKxXA8]m99YG
←IK|0AC]H↓8]w9qIKYG=IK|~)iCEY∃b\~∀4∃Aπ!CeCGQKefA=HAiKahAiQ¬hAQCYJAEK∃\AG←9mKei∃HAi↑↓9)K0≥fAS]QKeMC0AM←e4~∃Ce∀AgCS⊂Ai↑A	JA←L↓isaJ↓yCgG%R1G←⊃KxXA]QSGP↓SfAB↓gkEe¬]OJA=LAiQ∀AS]i∃OKef8~∀
∃y)sa∃b\\]|z~∃CCgG%R1G←⊃Jz`\8bdnv↓wgKm∃\[ESPA]k[	Keg|4∀~∃↓)QJA=eSOS9CXA9Aβ'πβ18AG←5aSYKHAoCf↓IKgS≥]KHA%\AiQ∀AYCi∀@laf0AoQK8AgSp5ESh~)GQCe¬GiKd↓gKif↓oKeJ↓G←[[=\XAg<AShA⊃SHA]=hA[C-JAae=mSgS=\AM←HAY←o∃dAGCMJ~∃Y∃iiKeL\A≥←]CICsLXA←L↓G←keMJXAo∀A]KK⊂Ai↑A⊃KCXA]SiPA	←iPAUaaKd↓C]HA1←oKd↓GCgJ4∃CYa!CEKiLAS\A∧AG←]YK]SK9hAoCdXAKgAKGSC1YrAS8ABAaI←OeC4AM←d↓isaKMKiiS9Nv~∃M↑AiQ∀AaeKMK]hAMaKGS→SGCi%←\A←_A9)Ka8AQCLAEKK8AoeSQiK\AU]IKd↓iQJA¬ggk[AiS←\4∃iQCPAiQJ↓9!β'
β→8A
←[aS1KdAC9HAek8[iS[∀AgsgQKZAa∃e[Sh↓iQJAUgJA←_AiKqPAMSY∃f~∃o%iPA[=eJAi!C\@lPAISgQS]Ok%gQCE1JAGQ¬eCGi∃ef\A5←eJAAeKGSMKYrX↓oJACMgk[J↓iQCh4∃iQJ↓GQCe¬GiKd↓gKhA
←]iC%]fACPAYKCMhAiQ∀AYKiQKefA¬]HAge[E←YLACgg=GSCi∃H~∃o%iPACMGSRA
←IKf↓Nh`↓iQe←UOPA≤bnlv↓CYXA=LAiQ∃gJAG!CeCGQKefA¬eJA]=n~∃CYCSYC	YJA←8A[←gPAG←[AkiKd↓iKe[%]CYf8~∀~∃MS]GJ↓oJACIJAIK¬YS]N↓oSiP↓[←eJ↓GQCe¬GiKeLAiQC8AoKe∀AaeKMK]hA%\AiQ∀AMSeMh~∃9Aβ'πβ18AG←5aSYKIfXAo∀AQCm∀Ai↑A⊃KGSI∀AoQCPAi↑A
CYXAQQJACMg←GS¬iKHA⊃CiB~)isaJ8A'←[∀A9!βMπβ_ALAkgJ↓iQJA=eSOS9CXA]¬[JAy
QCex↓M←dAQQJ~∃
QCeC
iKef↓S\Ai∃qhAM%YKfX↓KmK\↓iQ←k≥PAiQ∃eJA]=nACe∀A[←e∀AiQC8@lhAMkGP~)GQCe¬GiKeLXAoQ%YJA←QQKdAq!β'π¬_AfA
←]gS⊃KdAy
QCex↓i↑AE∀AB@lP[KYK5K]h~)gkEe¬]OJA=LABA1CeOKHAICi∧Aisa∀AiQCPAQCf↓g←[J↓←iQKHA]C[∀\~∀~)∪\A←IIKdAQ↑ACG
←[[←⊃CiJAQQSfA⊃SMMKIK]GJ0AoJAMQCYX↓kgJAQQJA]¬[JAyQKqh1
QCex4∃i↑AMiC]H↓M←dAQQJAI¬iBAieaJA←_AiQJ↓GQCe¬GiKeLAiQCPACeJ↓G←]m∃eiKH↓i↑AC9H~∃MI←ZAy¬gGSRaG←IKpAoQK8AiQKdACeJ↓S]akPAC]H↓←kiaUh\A/∀AgQC1XACYM↑ACgMk[J~)iQCh↓yiKqP1GQCIxAG←9gSgiLA←LAQQJAK1K[K]QfAyG!dQMSIgh1i∃qh1G!CdSx↓iQe←UOP~∃qGQdQ1Cgh1QKqh1
QCdSpXAS]p[GYkp[gSm∀\A)Q∀AM←Y1←oS]≤AIKM%]SiS=]fAg!←kYH↓EJ~∃¬IUkgQKHAS_A]KG∃ggCed\~∃↓ygsgi∃ZAIKAK]IK9GSKg|~∀~)↓HAi∃qh1G!Cd@ztAGQCHAwiQ∀AICi∧Aisa∀A←LA
QCeC
iKef↓S\Ai∃qhAM%YKg|4∃↓HA→SeghaiKqhaGQCdt`Aw←IIS]C0A]k[	KdA←_AiQJ↓g[CY1KghA∃YK[K9hA←L↓yiKqP1GQCIy|~∃↓HAYCMh1iKah1GQ¬dzbd\Aw←e⊃S]CX↓]k[E∃dA←L↓iQJA1CeOKMhAKY∃[K]h↓←LAyQKqh1
QCeyx~∀~∃y→←G¬XAmCISCEY∃fAM←HAS]SP\\]xz~∃Rh`\]Y¬gh1i∃qh1G!Cdv~(~∃AQQJA9QK18AAe←GKMg←dA
←]mKIifAE∃ioKK8ACgG%RAG←⊃JAC]⊂~∃iQ∀AkgKHOfAKaiKe]¬XAGQ¬eCGi∃dAgKPAErA5KC]f↓←LACIeCsf↓yq←e⊃xAC]⊂AyqG!ex~∃QQChA¬eJAC9CY←O=kfAi<A9!βMπβ_OLAy←e⊃xAC]⊂AyGQIxAMk9GiS←9f\~∀4∃y∂1←ECYL\\]xz~∃¬q←eHhACee¬rA7i∃qh1G!Ce:A=LACg
SR1G=IJv~(∪wga∃GSMS∃fAG←9mKeg%←\A←_AS]aUhAGQ¬eCGi∃eg|~)CqG!dtACIeCrAmCgGS$1G←I∃:A←L↓iKqhaGQCdl~∀∪wMaKGS→SKfA
←]mKIgS←\↓←LA←Uiakh↓GQCe¬GiKeM|~∀~)A'S9GJAo∀ACeJ↓Cggk5S]NAQQChA=kdA9Aβ'πβ18AgsMiKZA%fACE1JAi↑↓eKCH↓C]HA]eSiJ↓iQJ~)mSgS	YJAG!CeCGQKefA=LAgi¬]ICe⊂ACgG%R@QC1iQ←k≥PA]←PA]KG∃ggCe%YrAkMS]NAQQJ~∃¬gGSR↓G←IKLAi↑AIKaeKMK]hAQQKZR0AiQJ↓M←YY=oS]N↓CggS≥][K]PAgiCQK[K]QfAS]%iSCY%uJ~∃5←ghA=LAiQ∀AyqG!exACIeCrAAe←aKIYrXA]SiQ←UhA]K∃IS]N↓C]rAMsgiK4[IKa∃]IK]P~∃GQ¬]OKf8~∀~∃y'Kh↓S]Sh8\]|t~∃qG!e7NPa;>NNv~∃aGQe7Nhc;|NBNv4∃qGQI7NhI;>ND≤v~∃q
Qe7≤hg;>≤FNv~)qGQemNhiu>NHNl~∃qG!e7NPk;>N∀Nv~∃aGQe7Nhm;|NLNv4∃qGQI7Nh];>NN≤Nw↑4∃qGQI7NjA;>NP≤v~∃q
Qe7≤jc;>≤RNv~)qGQemNjeu>NTNl~∃qG!e7NTg;>N,Nv~∃aGQe7Nji;|NXNv4∃qGQI7NjU;>NZ≤v~∃q
Qe7≤jm;>≤\Nv~)qGQemNjou>N↑Nm↑~∃aGQe7Nla;|N`Nv4∃qGQI7NlE;>Nb≤v~∃q
Qe7≤le;>≤dNv~)qGQemNlgu>NfNl~∃qG!e7NXi;>NPNv~∃aGQe7Nlk;|NjNv4∃qGQI7NlY;>Nl≤v~∃q
Qe7≤lo;>≤nNw<~∃qG!e7N\a;>N`Nv~∃aGQe7Nnc;|NrNv4∃qGQI7NnI;>Nt≤v~∃q
Qe7≤ng;>≤vNv~)qGQemNniu>NxNl~∃qG!e7N\k;>NtNv~∃aGQe7Nnm;|N|Nv4∃qGQI7Nn];>N}≤w↑~)qGQemNb`A;>O↓Nv~∃aGQe7Nb`cu>OαNl~∃qG!e7ND`e;>≥∧Nv~)qGQemNb`M;>Oε≤v~∃q
Qe7≤b`i;|OλNv4∃qGQI7Nb@k;>O∀Nv~∃aGQe7Nb`mu>ONl~∃qG!e7ND`o;>≥∞Nw<~∃qG!e7NDba;>≥⊂Nv~)qGQemNbbE;>O∩≤v~∃q
Qe7≤bbe;|O∀Nv4∃qGQI7NbDg;>O,Nv~∃aGQe7Nbbiu>O_Nl~∃qG!e7NDbk;>≥~Nv~)qGQemNbbY;>O≤≤v~∃q
Qe7≤bbo;|O≡Nw↑~∃q
Qe7≤bda;|O Nv4∃qGQI7NbHc;>ODNv~∃aGQe7Nbdeu>O$Nl~∃qG!e7NDdg;>≥&Nv~)qGQemNbdQ;>O(≤v~∃q
Qe7≤bdk;|O*Nv4∃qGQI7NbHm;>OXNv~∃aGQe7Nbdou>O.Nm↑~∃aGQe7Nbfau>O0Nl~∃qG!e7NDfc;>≥2Nv~)qGQemNbfI;>O4≤v~∃q
Qe7≤bfg;|O6Nv4∃qGQI7NbLi;>OpNv~∃aGQe7Nbfku>O:Nl~∃qG!e7NDfm;>≥<Nv~)qGQemNbf];>N0≤w↑~)qGQemNbhA;>O@≤v~∃q
Qe7≤bhc;|OBNv4∃qGQI7NbPe;>OλNv~∃aGQe7Nbhgu>OFNl~∃qG!e7NDhi;>≥HNv~)qGQemNbhU;>OJ≤v~∃q
Qe7≤bhm;|OLNv4∃qGQI7NbPo;>O≤Nw↑4∃qGQI7NbTa;>O Nv~∃aGQe7Nbjcu>ORNl~∃qG!e7NDje;>≥TNv~)qGQemNbjM;>OV≤v~∃q
Qe7≤bji;|OXNv4∃qGQI7NbTk;>O4Nv~∃aGQe7Nbjmu>O\Nl~∃qG!e7NDjo;>≥↑Nw<~∃qG!e7NDla;>≥`Nv~)qGQemNblE;>Ob≤v~∃q
Qe7≤ble;|OdNv4∃qGQI7NbXg;>OLNv~∃aGQe7Nbliu>OhNl~∃qG!e7NDlk;>≥jNv~)qGQemNblY;>Ol≤v~∃q
Qe7≤blo;|OnNw↑~∃q
Qe7≤bna;|OpNv4∃qGQI7Nb\c;>OdNv~∃aGQe7Nbneu>OtNl~∃qG!e7NDng;>≥vNv~)qGQemNbnQ;>Ox≤v~∃q
Qe7≤bnk;|O|Nv4∃qGQI7Nb\m;>NhNw↑4∃qGQI6a;>≤@NvAaGQe7Nbnou>N@Nl~∀∪w¬gGSR↓G←IKL@`AC9HAy≤bnox↓I↑A]=hACaAKCdA%\AiKai|~∀4∃A'=[JA←_AiQJ↓CgGS$AG←I∃fAoSQQ←kh↓mSgS	YJAG!CeCGQKefA!CmJA	KK\A≥SmK\↓gs[E=YSF~)]C[KLAS\AQQSfAAe←Oe¬ZAEK
CkgJ↓iQKr↓CeJAUgKHA]SiPA∧AgaK
SCXA5KC]S9N\~∀4∃↓HA9kYX1
←IJ{N`Aw¬gGSR↓G←IJ↓iQCh↓[SOQPAISg¬aaKCI|~∃↓⊂AGCeISCOJaeKikI\{NDjAwCMGSRA
←IJAUgKHA¬hAK]⊂A←LA1S]K|4∃↓HA%]mCY%H1G←⊃J{NDnnAw¬gGSR↓G←IJ↓iQCh↓gQ←k1HA]←PACaa∃Ce|~(~∃AQQJACMGSRA
←IJA%fAAAMiC]I¬eHNN↓←]Yr↓i↑AB↓GKei¬S\AKaiK]h0AgS]
JA[C9r~∃G=[aki∃dAS]MiCYY¬iS←]LAQCm∀AM←k9HASh↓CImC9iCOK=kfAi<AQCm∀AeKC⊃rACG
Kgf~)i↑A[=eJAi!C\@rPAaeS9iS]N↓GQCe¬GiKeL\AβaAK]ISa↓↓εA=LAiQ∀A9)Ka8A[C9kCX~)OSmKLABAG=[aYKQJAga∃GSMS
CiS←8A←LAQQJAS9iK]I∃HAG←IeKga=]IK]
JAEKQoKK\4∃GQCICGiKIfAC]⊂A9)K`OfAS9iKe]¬XAeKAeKgK9iCiS=\\~∀4∃∪LAq)K18↓SfAE∃S]NAUgKH~)←\ABgarden-variety \PASCAL\ for which only standard ascii
codes will appear in the input and output files, it doesn't really matter
what codes are specified in |xchr[1..@'37]|, but the safest policy is to
blank everything out by using the code shown below.

However, other settings of |xchr| will make \TeX\ more friendly on
computers that have an extended character set, so that users can type things
like \.\NE\ instead of \.{\\ne}. At MIT, for example, it would be more
appropriate to substitute the code
$$\hbox{|for i←1 to @'37 do xchr[i]←chr(i);|}$$
\TeX's character set is essentially the same as MIT's, even with respect to
characters less than@@@'40. People with extended character sets can
assign codes arbitrarily, giving an |xchr| equivalent to whatever
characters the users of \TeX\ are allowed to have in their input files,
provided that unsuitable characters do not correspond to the special
codes like |carriage_return| that are listed above. It is best
to make the codes correspond to the intended interpretations as shown
in Appendix@@C whenever possible, because of the way \TeX\ will interpret
characters when no \.{\\chcode} and \.{\\mathcode}
commands have changed the default interpretation; but this is not
necessary. For example, in countries with an alphabet of more than 26
letters, it is usually best to map the additional letters into codes less
than@@@'40.
@↑character set dependencies@>
@↑system dependencies@>

@<Set init...@>=
for i←1 to @'37 do xchr[i]←' ';

@ The following system-independent code makes the |xord| array contain a
suitable inverse to the information in |xchr|. Note that if |xchr[i]=xchr[j]|
where |i<j<@'177|, the value of |xord[xchr[i]]| will turn out to be
|j| or more; hence, standard ascii code numbers will be used instead of
codes below @'40 in case there is a coincidence.

@<Set init...@>=
for i←first_text_char to last_text_char do xord[chr(i)]←invalid_code;
for i←1 to @'176 do xord[xchr[i]]←i;
@* String handling.
(The following material is copied from the |init_strings| procedure of
\TeX82, with slight changes.)

@<Glob...@>=
@!k,@!l:0..127; {small indices or counters}
@!m,@!n:text_char; {characters input from |pool_file|}
@!s:integer; {number of strings treated so far}

@ The global variable |count| keeps track of the total number of characters
in strings.

@<Glob...@>=
@!count:integer; {how long the string pool is, so far}

@ @<Set init...@>=
count←0;

@ This is the main program, where \.{POOLtype} starts and ends.

@d abort(#)==begin write_ln(#); goto 9999;
	end

@p begin initialize;@/
@<Make the first 128 strings@>;
s←128;@/
@<Read the other strings from the \.{POOL} file,
	or give an error message and abort@>;
write_ln('(',count:0,' characters in all.)');
9999:end.

@ @<Make the first 128...@>=
for k←0 to 127 do
	begin write(k:3,': "');
	if (k<" ")∧(@<Character |k| cannot be printed@>) then
		begin write(xchr["↑"], xchr["↑"], xchr[k+@'100]);
		count←count+2;
		end
	else if k=127 then
		begin write(xchr["↑"], xchr["↑"], xchr["?"]);
		count←count+2;
		end
	else if k="""" then write(xchr[k],xchr[k])
	else write(xchr[k]);
	incr(count); write_ln('"');
	end

@ The first 128 strings will contain 95 standard ascii characters, and the
other 33 characters will be printed in three-symbol form like `\.{\↑\↑A}'
unless a system-dependent change is made here. Installations that have
an extended character set, where for example |xchr[@'32]=@t\.{\'\NE\'}@>|,
would like string @'32 to be the single character @'32 instead of the
three characters @'136, @'136, @'132 (\.{\↑\↑Z}). On the other hand,
even people with an extended character set will want to represent string
@'15 by \.{\↑\↑M}, since @'15 is |carriage_return|; the idea is to
produce visible strings instead of tabs or line-feeds or carriage-retqrns
or bell-rings or characters that are treated anomalously in text files.

The boolean expression defined here should be |true| unless \TeX\ internal code
$k$ corresponds to a non-troublesome visible symbol in the local character
set, given that |k<@'40|.
At MIT, for example, the appropriate formula would be
`|k in [0,@'10..@'12,@'14,@'15,@'33]|'.
@↑character set dependencies@>
@↑system dependencies@>

@<Character |k| cannot be printed@>=
	true

@ When the \.{WEB} system program called \.{TANGLE} processes a source file,
it outputs a \PASCAL\ program and also a string pool file. The present
program reads the latter file, where each string appears as a two-digit decimal
length followed by the string itself, and the information is output with its
associated index number. The strings are surrounded by double-quote marks;
double-quotes in the string itsElf are repeated.

@<Glob...@>=
@!pool_file:packed file of text_char;
	{the string-pool file output by \.{TANGLE}}
@!xsum:boolean; {has the check sum been found?}

@ @<Read the other strings...@>=
reset(pool_file); xsum←false;
if eof(pool_file) then abort('! I can''t read the POOL file.');
repeat @<Read one string, but abort if there are problems@>;
until xsum;
if not eof(pool_file) then abort('! There''s junk after the check sum')

@ @<Read one string...@>=
if eof(pool_file) then abort('! POOL file contained no check sum');
read(pool_file,m,n); {read two digits of string length}
if m≠'*' then
	begin if (xord[m]<"0")∨(xord[m]>"9")∨(xord[n]<"0")∨(xord[n]>"9") then
		abort('! POOL line doesn''t begin with two digits');
	l←xord[m]*10+xord[n]-"0"*11; {compute the length}
	write(s:3,': "'); count←count+l;
	for k←1 to l do
		begin if eoln(pool_file) then
			begin write_ln('"'); abort('! That POOL line was too short');
			end;
		read(pool_file,m); write(xchr[xord[m]]);
		if xord[m]="""" then write(xchr[""""]);
		end;
	write_ln('"'); incr(s);
	end
else xsum←true;
read_ln(pool_file)
@* System-dependent changes.
This module should be replaced, if necessary, by changes to the program
that are necessary to make \.{POOLtype} work at a particular installation.
It is usually best to design your change file so that all changes to
previous modules preserve the module numbering; then everybody's version
will be consistent with the printed program. More extensive changes,
which introduce new modules, can be inserted here; then only the index
itself will get a new module number.
@↑system dependencies@>
@* Index.
Indications of system dependencies appear here together with the section numbers
where each ident\-i\-fier is used.